package com.moss.cloud.common.core.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class UserEventDTO implements Serializable {
    public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    private Long id;
    /** 用户ID */
    private Long userId;
    /** 锁定状态 0已解锁，1锁定*/
    private Boolean lockState;
    /**锁定时间*/
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = DATE_FORMAT)
    private LocalDateTime lockTime;
    /**解锁时间*/
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = DATE_FORMAT)
    private LocalDateTime unlockTime;
    /**锁定原因*/
    private String lockReason;
    /**解锁原因*/
    private String unlockReason;

    /** 用户名 */
    private String username;
    /** 用户密码密文 */
    private String password;
    /** 用户姓名 */
    private String name;
    /** 用户手机 */
    private String mobile;
    /** 简介 */
    private String description;
    /** 是否有效用户 */
    private Boolean enabled;
    /** 账号是否未过期 */
    private Boolean accountNonExpired;
    /** 密码是否未过期 */
    private Boolean credentialsNonExpired;
    /** 是否未锁定 */
    private Boolean accountNonLocked;
    /** 用户邮箱 */
    private String email;
    /** 租户ID */
    private Long tenantId;
    /** 用户头像 */
    private String avatar;
    /** 状态（0正常，1锁定） */
    private Integer state;
    /** 用户性别（0男，1女） */
    private Integer sex;
    /** 用户性别（0男，1女） */
    private String openId;
    /** 用户所属部门*/
    private Long deptId;
    /** 生日*/
    private LocalDate birthday;

    private String createdBy;
    private String updatedBy;
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = DATE_FORMAT)
    private LocalDateTime createdTime;
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = DATE_FORMAT)
    private LocalDateTime updatedTime;
    /** 是否禁用（0启用；1禁用；2删除） */
    private Integer deleted;
}
